import { defineConfig } from 'vite'
import vue from '@Vitejs/plugin-vue'
import path from 'path'
// 调试工具看到组件name插件
import vueSetupExtend from 'vite-plugin-vue-setup-extend'
import vueJsx from '@vitejs/plugin-vue-jsx'
// const path = require('path')
export default defineConfig({
    plugins: [vue(), vueSetupExtend(), vueJsx()],
    resolve: {
        alias: {
            '@': path.resolve(__dirname, './src'),
        },
    },
    server: {
        // 配置域名
        host: 'www.corho.com',
        port: 8080,
        open: true, // 帮我们打开浏览器
        cors: true, // 允许开发时 ajax 跨域
    },
    css: {
        preprocessorOptions: {
            less: {
                additionalData: `
                    @import "@/assets/styles/variables.less";
                    @import "@/assets/styles/mixins.less";
                `,
            },
        },
    },
    
})